home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -screenplay- / hd_installers / -whdload- / whdload_dev / src / programs / wdate.asm < prev    next >
Assembly Source File  |  1998-07-16  |  2KB  |  90 lines

  1. ;*---------------------------------------------------------------------------
  2. ;  :Program.    WDate.asm
  3. ;  :Contents.    Create Date-String for $VER ... INCBIN
  4. ;  :Author.    Bert Jahn
  5. ;  :EMail.    jah@pub.th-zwickau.de
  6. ;  :Address.    Franz-Liszt-Straße 16, Rudolstadt, 07404, Germany
  7. ;  :History.    V 1.0 27-Feb-95
  8. ;        V 1.1 07.01.96 format changed (INT -> DOS)
  9. ;  :Copyright.    Public Domain
  10. ;  :Language.    68000 Assembler
  11. ;  :Translator.    Barfly V1.117
  12. ;---------------------------------------------------------------------------*
  13. ;####################################################################
  14.  
  15.     INCDIR    Includes:
  16.     INCLUDE    dos/datetime.i
  17.     INCLUDE    lvo/dos.i
  18.     INCLUDE lvo/exec.i
  19.  
  20.     INCLUDE    macros/ntypes.i
  21.     
  22.     NSTRUCTURE    globals,0
  23.         NSTRUCT    gl_datetime,dat_SIZEOF
  24.         NSTRUCT    gl_strtime,LEN_DATSTRING
  25.         NSTRUCT    gl_strdate,LEN_DATSTRING
  26.         NALIGNLONG
  27.         NLABEL  gl_SIZEOF
  28.         
  29. ;####################################################################
  30.  
  31.     PURE                ;set pure-bit
  32.         bra    .start
  33.         dc.b    "$VER: WDate 1.1 "
  34.     DOSCMD    "WDate >T:date"
  35.     INCBIN    "T:date"
  36.         dc.b    " by Bert Jahn"
  37.         dc.b    " (Create DateString for $VER using INCBIN)",0
  38.     EVEN
  39. .start
  40.         link    a5,#gl_SIZEOF        ;a5 = global vars
  41.         moveq    #37,d0
  42.         lea    (_dosname),a1
  43.         move.l    (4),a6
  44.         jsr    (_LVOOpenLibrary,a6)
  45.         tst.l    d0
  46.         beq    .quit
  47.         move.l    d0,a6            ;a6 = dosbase global !
  48.         
  49.         lea    (gl_datetime+dat_Stamp,a5),a0
  50.         move.l    a0,d1
  51.         jsr    (_LVODateStamp,a6)
  52.  
  53.         lea    (gl_datetime,a5),a0
  54.         move.b    #FORMAT_DOS,(dat_Format,a0)
  55.         clr.b    (dat_Flags,a0)
  56.         clr.l    (dat_StrDay,a0)
  57.         lea    (gl_strdate,a5),a1
  58.         move.l    a1,(dat_StrDate,a0)
  59.         lea    (gl_strtime,a5),a1
  60.         move.l    a1,(dat_StrTime,a0)
  61.         move.l    a0,d1
  62.         jsr    (_LVODateToStr,a6)
  63.         tst.l    d0
  64.         beq    .closedos
  65.  
  66.         lea    (_outstr),a0
  67.         move.l    a0,d1
  68.         pea    (gl_strtime,a5)
  69.         pea    (gl_strdate,a5)
  70.         move.l    a7,d2
  71.         jsr    (_LVOVPrintf,a6)
  72.         addq.l    #8,a7
  73.  
  74. .closedos    move.l    a6,a1
  75.         move.l    (4),a6
  76.         jsr    (_LVOCloseLibrary,a6)
  77. .quit        unlk    a5
  78.         moveq    #0,d0
  79.         rts
  80.  
  81. ;####################################################################
  82.  
  83. _outstr        dc.b    "(%s%s)",0
  84. _dosname    dc.b    "dos.library",0
  85.  
  86. ;####################################################################
  87.  
  88.     END
  89.  
  90.